<?php
/**
 * Defines Kodform_Element_Reset class
 *
 *
 * Kodform.php - kodform4
 * @copyright 	Copyright (c) 2006 Boris Tomic (kodmasin.net)
 * @category 	Kodform
 * @package 	Kodform
 * @author 		Boris Tomic
 * @license 	http://boris.kodmasin.net/kodform4:license The BSD License
 *
 */
require_once 'Kodform/Element.php';
require_once 'Kodform/Attributes.php';

/**this is just HTML reset element */
class Kodform_Element_Reset extends Kodform_Element{
	/**
	 * creates reset element
	 *
	 * @param string $id unique id of this element
	 * @param string $label display label of this element
	 */
	function __construct($id, $label){
		parent::__construct($id);
		$this->displayName = $label;
	}
	/**
	 * reset is always valid so here is overloaded Kod_Form_Element method
	 * 
	 * @return boolean always true
	 */
	function validate(){
		return true;
	}
	/**
	 * default display (rendering)
	 */
	function display(Kodform_Attributes $attributes = null){
		if($attributes === null)
			$attributes = new Kodform_Attributes();
		?>
<input id="<?php print $this->id?>" name="<?php print $this->id?>" type="reset"<?php print $attributes->normal->display();?> value="<?php print $this->displayName;?>" />
<?php
	}
}
